package com.zkthink.zhl.order.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zkthink.base.R;
import com.zkthink.base.controller.SuperController;
import com.zkthink.base.request.PageParams;
import com.zkthink.clh.order.dto.ChlOrderPageDTO;
import com.zkthink.clh.order.dto.ChlOrderSaveDTO;
import com.zkthink.clh.order.dto.ChlOrderUpdateDTO;
import com.zkthink.clh.order.dto.CouponsPageDTO;
import com.zkthink.clh.order.entity.ChlCoupons;
import com.zkthink.clh.order.entity.ChlOrder;
import com.zkthink.security.annotation.PreAuth;
import com.zkthink.zhl.order.service.ChlOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * 前端控制器
 * 车惠龙订单表
 * </p>
 *
 * @author chenke
 * @date 2022-04-24
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/chlOrder")
@Api(value = "ChlOrder", tags = "车惠龙订单表")
@PreAuth(replace = "chlOrder:")
public class ChlOrderController extends SuperController<ChlOrderService, Long, ChlOrder, ChlOrderPageDTO, ChlOrderSaveDTO, ChlOrderUpdateDTO> {

    @ApiOperation(value = "后台查询车惠龙订单表", notes = "后台查询车惠龙订单表")
    @PostMapping(value = "/page")
    public R<IPage<ChlOrder>> page(@RequestBody PageParams<ChlOrderPageDTO> dto) {
        ChlOrderPageDTO model = dto.getModel();
        IPage page = dto.getPage();
        return R.success(baseService.page(page, model));
    }
    @ApiOperation(value = "假删除", notes = "假删除")
    @GetMapping(value = "/updateChlOrderDelete/{id}")
    public R updateChlOrderDelete(@PathVariable("id") Long id) {
        return R.success(baseService.updateChlOrderDelete(id));
    }
}